home *** CD-ROM | disk | FTP | other *** search
- Date: Fri, 6 May 94 11:47 PDT
- From: dant@u.washington.edu
- Subject: [*] ResTest; a resolution test pattern in postscript
-
- The following is an excerpt from the comments in the file:
-
- % This chart started out with video cameras in mind, but can be used to
- % test about any image input or output device. Print it (it is a
- % postscript file) or input it (scan it, frame grab it) from hard copy;
- % note where the converging lines are no longer separate. The patterns
- % it has are: a circle of wedges, two long wedges, a series of line widths,
- % and a range of font sizes.
-
- % One nice thing about postscript is that it scales with the capabilities of
- % the device. This chart goes from 200 to over 5000 lines/image (from 35 to
- % over 1000 lines/inch), whatever the device can do.
-
- % Dan Tomandl; University of Washington. dant@u.washington.edu
- --------------------------------cut here-----------------------------------
- %!PS-Adobe-1.0
-
- % Resolution Chart
-
- % This chart started out with video cameras in mind, but can be used to
- % test about any image input or output device. Print it (it is a
- % postscript file) or input it (scan it, frame grab it) from hard copy;
- % note where the converging lines are no longer separate. The patterns
- % it has are: a circle of wedges, two long wedges, a series of line widths,
- % and a range of font sizes.
-
- % One nice thing about postscript is that it scales with the capabilities of
- % the device. This chart goes from 200 to over 5000 lines/image (from 35 to
- % over 1000 lines/inch), whatever the device can do. Ideally your printed
- % copy will have enough resolution to adequately challenge your input
- % device; if not, and if your input device is a camera, you could just back
- % off until the the chart takes up only a fraction of the image. Of course
- % you would then use that fraction to scale up the chart resolution numbers.
-
- % To get this file to your printer, print it, or download it.
- % One way to print it is with MS Word: select all, change style to
- % Postscript, then print to a postscript printer.
-
- % Interpretation example: let's say the lines blend together at the second
- % dashed circle (the first one inside the edge) in the upper half of the
- % circular test pattern. The resolution is 300 lines across the vertical
- % dimension, 400 across the horizontal (in []) (the box and TVs have a 3 x
- % 4 aspect ratio), and 51 lines/inch (in {}). Note that numbers include
- % *both* the black and white lines. Lines/inch is comparable to dots/inch
- % or pixels/inch; divide by 2 to get line pairs/inch.
-
- % After testing several scanners and printers I noticed a fairly consistent
- % pattern: the lines merged at about half the dpi for the
- % laser printers I tested (from 300 to 1200 dpi). The scanners I tested
- % picked up line separations down to their dpi specs.
-
- % I couldn't resist filling some unused space with more test patterns. I
- % put in some font sizes, then the line width progressions around the edges;
- % finally the sparse line progression on the bottom (to get an uncrowded
- % view of small line widths) and the long wedges (which have the same
- % widths as the progression near them). Enjoy.
-
- % Dan Tomandl; University of Washington; 3/94.
- % Permission is hereby given to freely use this file. Comments and
- % questions may be addressed to dant@u.washington.edu
-
- % Construction details:
- % At res=200 lines .0285in/line; radius=2.04in ==>.8deg; 450 lines/circle;
- % 225 dark wedges .8 deg each; 35.1 lines/in.
- % RETMA resolution chart 1956 was used as a guide.
-
- 72 72 scale % use inches
- /Times-Roman findfont .20 scalefont setfont
- .02 setlinewidth
- 4.25 5.5 translate
- 90 rotate % landscape
- 0 setgray % for fills
-
- newpath
- /rad 2.04 def
- 0 1.6 180 % top half of circle
- {gsave
- rotate
- newpath
- rad 0 moveto 0 0 lineto
- .8 rotate
- rad 0 lineto
- closepath
- fill
- grestore
- } for
-
- 180 0.4 360 % bottom half of circle; lines 4 times as dense as top
- {gsave
- rotate
- newpath
- rad 0 moveto 0 0 lineto
- .2 rotate
- rad 0 lineto
- closepath
- fill
- grestore
- } for
- newpath
- 15 45 360 % make dashed circles
- {/a exch def
- 0 0 rad a a 15 add arc stroke % res=200
- 0 0 rad 2 mul 3 div a a 15 add arc stroke % res=300
- 0 0 rad 2 div a a 15 add arc stroke % res=400
- 0 0 rad 2 mul 5 div a a 15 add arc stroke % res=500
- 0 0 rad 2 mul 7 div a a 15 add arc stroke % res=700
- 0 0 rad 2 mul 9 div a a 15 add arc stroke % res=900
- 0 0 rad 2 mul 12 div a a 15 add arc stroke % res=1200
- } for
-
- % labels
- 0 -.1 translate
- rad -1.3 add rad moveto (200 [267] {35}) show
- rad -.4 add rad 2 mul 3 div moveto (300 [400] {53}) show
- rad -.15 add rad 2 div moveto (400 [533] {70}) show
- rad -.08 add rad 2 mul 5 div moveto (500 [667] {88}) show
- /Times-Roman findfont .15 scalefont setfont
- rad .00 add rad 2 mul 7 div moveto (700 [933] {123}) show
- rad .02 add rad 2 mul 9 div moveto (900 [1200] {158}) show
- rad .02 add rad 2 mul 12 div moveto (1200 [1600] {211}) show
- 0 .1 translate
- rad -1.3 add rad neg moveto (800 [1067] {140}) show
- rad -.40 add rad 2 mul 3 div neg moveto (1200 [1600] {211}) show
- rad -.15 add rad 2 div neg moveto (1600 [2133] {281}) show
- rad -.08 add rad 2 mul 5 div neg moveto (2000 [2667] {351}) show
- rad .00 add rad 2 mul 7 div neg moveto (2800 [3733] {491}) show
- rad .02 add rad 2 mul 9 div neg moveto (3600 [4800] {632}) show
- rad .02 add rad 2 mul 12 div neg moveto (4800 [6400] {842}) show
- /Times-Roman findfont .20 scalefont setfont
-
-
- % font size sampler
- gsave
- -3.2 2.0 translate
-
- /c .40 def
- /bb 20 string def
- .40 -.10 .20
- {/b exch def
- /Times-Roman findfont b scalefont setfont
- /c c b sub def
- 0 c moveto b bb cvs show
- } for
-
- .15 -.01 .01
- {/b exch def
- /Times-Roman findfont b scalefont setfont
- /c c b sub def
- 0 c moveto b bb cvs show
- } for
- grestore
-
- gsave
- -3.2 0 translate
- .0139 .0139 scale % use points
-
- /c 0 def
- 1 1 15
- {/b exch def
- /Times-Roman findfont b scalefont setfont
- /c c b .95 mul sub def
- 0 c moveto b bb cvs show
- } for
-
- 20 10 30
- {/b exch def
- /Times-Roman findfont b scalefont setfont
- /c c b .95 mul sub def
- 0 c moveto b bb cvs show
- } for
-
- /Times-Roman findfont 14 scalefont setfont
- -11 -177 moveto (Font size in points) show
- grestore
-
-
- /box {
- -3.8 -2.85 moveto
- 3.8 -2.85 lineto
- 3.8 2.85 lineto
- -3.8 2.85 lineto
- closepath
- stroke
- } def
-
- box
- gsave
- /Times-Roman findfont .30 scalefont setfont
- -1.00 3.50 moveto (Resolution Chart) show
- grestore
- -3.35 2.35 moveto (Font size in inches) show
- -2.43 2.17 moveto (\(vertical size =) show
- -2.43 1.97 moveto (~70\% of font size\)) show
- 0.1 2.36 moveto gsave (Lines \(black + white\)/vertical dimension) show
- grestore
- 0.8 -.18 rmoveto gsave ([Lines/horizontal dimension]) show
- grestore
- 1.30 -.18 rmoveto ({Lines/inch}) show
- gsave
- /Times-Roman findfont .12 scalefont setfont
- -0.8 -3.80 moveto (Spaces are 50 times wider than lines) show
- grestore
-
- gsave
- .9 .9 scale
- box
- /Times-Roman findfont .18 scalefont setfont
- -1.5 -2.7 moveto (For camera, outer edge should just show. ) show
- (It measures 7.6 by 5.7 inches.) show
- grestore
-
-
- % bars: top
- gsave
- -3.425 2.85 translate
- /a 6.850 def % length of bar
- /aa 7.60 def % width of full test area
- /b 0 def % distance along bar; init to 0
- /lw1 aa 300 div def % beginning line width
- /lw2 .0001 def % ending line width
- /c lw1 lw2 sub a div def
- % lw = (a-b)/a * (lw1-lw2) + lw2 = (a-b)*c + lw2
- /lwold lw1 def
- {/lw a b sub c mul lw2 add def
- lw setlinewidth
- b 0 moveto b -.277 lineto stroke
- lw lw2 le {exit} if
- /b b 2 lw mul add lw lwold sub 2 div add def
- % b = b+2*lw-(lwold-lw)/2 ; correction is to make the space same size as
- % previous line; next line is smaller than previous so correction is needed.
- /lwold lw def
- } loop
-
- %labels: lines/aa is lpaa=aa*lpi; lpi=1/lw; lw=1/lpi=aa/lpaa
- % b = a-a*(lw-lw2)/(lw1-lw2) = a-(lw-lw2)/c
- .02 setlinewidth
- /bb 20 string def
- /Times-Roman findfont .15 scalefont setfont
- % input is lpaa to lab
- /lab {dup dup aa exch div lw2 sub c div neg a add 0 moveto
- gsave
- 0 -.277 rmoveto 0 -.05 rlineto stroke
- grestore
- 0 .08 rlineto
- -.13 .02 rmoveto
- gsave
- ({) show aa div round cvi bb cvs show (}) show
- grestore
- 0 .17 rmoveto
- ([) show bb cvs show (]) show stroke} def
- 300 lab
- 400 lab
- 500 lab
- 700 lab
- 900 lab
- 1200 lab
- 1600 lab
- 2400 lab
- 4000 lab
- /tic {dup dup aa exch div lw2 sub c div neg a add 0 moveto
- 0 .04 rlineto stroke} def
- 600 100 2400 {tic} for
- 3000 1000 7000 {tic} for
-
-
- % bars, bottom:
- grestore
- gsave
- -3.425 -2.85 translate
- /b 0 def % distance along bar; init to 0
- /lwold lw1 def
- {/lw a b sub c mul lw2 add def
- lw setlinewidth
- b 0 moveto b .277 lineto stroke
- lw lw2 le {exit} if
- /b b 2 lw mul add lw lwold sub 2 div add def % b = b+2*lw-(lwold-lw)/2
- /lwold lw def
- } loop
-
- %labels
- .02 setlinewidth
- /Times-Roman findfont .15 scalefont setfont
- % input is lpi to lab
- /lab {dup aa mul dup aa exch div lw2 sub c div neg a add 0 moveto
- gsave
- 0 .277 rmoveto 0 +.05 rlineto stroke
- grestore
- 0 -.08 rlineto
- -.13 -.12 rmoveto
- gsave
- ({) show exch bb cvs show (}) show
- grestore
- 0 -.17 rmoveto
- ([) show round cvi bb cvs show (]) show stroke} def
- 40 lab
- 50 lab
- 60 lab
- 80 lab
- 100 lab
- 120 lab
- 150 lab
- 200 lab
- 300 lab
- 600 lab
- /tic {dup aa mul dup aa exch div lw2 sub c div neg a add 0 moveto
- 0 -.04 rlineto stroke} def
- 40 10 100 {tic} for
- 200 100 1000 {tic} for
-
-
- % bars, below bottom, spaces = 50x line width
- % an uncrowded test for narrow lines
- 0 -.80 translate
- /b 0 def % distance along bar; init to 0
- {/lw a b sub c mul lw2 add def
- lw setlinewidth
- b 0 moveto b .277 lineto stroke
- lw lw2 le {exit} if
- /b b 50 lw mul add def % b = b+50*lw
- } loop
-
- %labels
- .02 setlinewidth
- /Times-Roman findfont .15 scalefont setfont
- % input is lpi to lab
- /lab {dup aa mul dup aa exch div lw2 sub c div neg a add 0 moveto
- 0 .277 rmoveto
- 0 .08 rlineto stroke } def
- 40 lab
- 50 lab
- 60 lab
- 80 lab
- 100 lab
- 120 lab
- 150 lab
- 200 lab
- 300 lab
- 600 lab
- /tic {dup aa mul dup aa exch div lw2 sub c div neg a add 0 moveto
- 0 .277 rmoveto
- 0 .04 rlineto stroke} def
- 40 10 100 {tic} for
- 200 100 1000 {tic} for
-
- % wedge:
- newpath
- 0 -.02 moveto
- 6.85 -.02 lineto
- 0 -.045 lineto
- closepath
- fill
-
-
- % bars: left
- grestore
- gsave
- -3.800 2.85 translate
- /a 5.700 def % length of bar
- /aa 5.70 def % width of full test area
- /b 0 def % distance along bar; init to 0
- /lw1 aa 200 div def % beginning line width
- /c lw1 lw2 sub a div def
- % lw = (a-b)/a * (lw1-lw2) + lw2 = (a-b)*c + lw2
- /lwold lw1 def
- {/lw a b sub c mul lw2 add def
- lw setlinewidth
- 0 b neg moveto .370 0 rlineto stroke
- lw lw2 le {exit} if
- /b b 2 lw mul add lw lwold sub 2 div add def % b = b+2*lw-(lwold-lw)/2
- /lwold lw def
- } loop
-
- %labels: lines/aa is lpaa=aa*lpi; lpi=1/lw; lw=1/lpi=aa/lpaa
- % b = a-a*(lw-lw2)/(lw1-lw2) = a-(lw-lw2)/c
- .02 setlinewidth
- /bb 20 string def
- /Times-Roman findfont .15 scalefont setfont
- % input is lpaa to lab
- /lab {dup dup aa exch div lw2 sub c div neg a add neg 0 exch moveto
- gsave
- .370 0 rmoveto .05 0 rlineto stroke
- grestore
- -.08 0 rlineto
- -.75 -.035 rmoveto
- bb cvs show
- ( {) show aa div round cvi bb cvs show (}) show stroke} def
- 200 lab
- 250 lab
- 300 lab
- 400 lab
- 500 lab
- 700 lab
- 900 lab
- 1200 lab
- 2000 lab
- 2800 lab
- 4800 lab
-
-
- % bars: right
- grestore
- 3.800 2.85 translate
- /b 0 def % distance along bar; init to 0
- /lwold lw1 def
- {/lw a b sub c mul lw2 add def
- lw setlinewidth
- 0 b neg moveto -.370 0 rlineto stroke
- lw lw2 le {exit} if
- /b b 2 lw mul add lw lwold sub 2 div add def % b = b+2*lw-(lwold-lw)/2
- /lwold lw def
- } loop
-
- %labels: lines/aa is lpaa=aa*lpi; lpi=1/lw; lw=1/lpi=aa/lpaa
- % b = a-a*(lw-lw2)/(lw1-lw2) = a-(lw-lw2)/c
- .02 setlinewidth
- /bb 20 string def
- /Times-Roman findfont .15 scalefont setfont
- % input is lpi to lab
- /lab {dup aa mul dup aa exch div lw2 sub c div neg a add neg 0 exch moveto
- gsave
- -.370 0 rmoveto -.05 0 rlineto stroke
- grestore
- .08 0 rlineto
- .02 -.035 rmoveto
- round cvi bb cvs show
- ( {) show bb cvs show (}) show stroke} def
- 35 lab
- 40 lab
- 50 lab
- 60 lab
- 80 lab
- 100 lab
- 120 lab
- 150 lab
- 200 lab
- 300 lab
- 600 lab
- /tic {dup aa mul dup aa exch div lw2 sub c div neg a add neg 0 exch moveto
- .04 0 rlineto stroke} def
- 40 10 100 {tic} for
- 200 100 1000 {tic} for
-
- % wedge:
- newpath
- .9 0 moveto
- .9 -5.7 lineto
- .9285 0 lineto
- closepath
- fill
-
- showpage
- % end
-
-
-